<?php


class Test_password_hashing extends CI_Controller {

	public function __construct() {
		parent::__construct(); 
                
                
	}

	public function index() {
            
            $this->load->library('encrypt');
            $password = 'mypassword';

            $salt = 'secretsalt_';
            echo "Password is " . $password . " and salt is " . $salt . ".</br>";
            $unencrypted_salted = $salt . $password;

            $md5salt = md5($salt . $password);
            
            echo "md5 password is " . $md5salt . ".</br>";
            
            $doublemd5 = md5($md5salt);
            
            $superencrypted = $this->encrypt->encode($md5salt);
            
            echo "super encrypted password is " . $superencrypted . ".</br>";
            
            $decrypted = $this->encrypt->decode($superencrypted);

            echo "and back again: </br>";
            
            echo "unencrypted password is " . $decrypted . ".</br>";
            
            
            
            
        }
}